<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box1 {
            width: 300px;
            height: 500px;
            margin: 100px auto;
            padding:20px;
            border: 1px solid #ccc;
        }

        #box2 {
            position: relative;
            width: 100%;
            height: 0;
            padding-top: 100%;
            background: blanchedalmond
        }

        #box3 {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: burlywood;
        }
    </style>
</head>

<body>
    <div id="box1">
        <div id="box2">
            <div id="box3"></div>
        </div>
        <div>文本</div>
    </div>
</body>

</html>